package cc.magicjson.design.principles.openclose;

import java.math.BigDecimal;

/**
 * {@link}
 *
 * @author <a href="mailto:it_magicjson@163.com">MagicJson</a>
 * @since 1.0.0
 */
public class JavaDiscountCourse extends JavaCourse{

    private BigDecimal price;

    public BigDecimal getDiscountCourse(){
        return BigDecimal.valueOf(price.doubleValue() * 0.8);
    }
    public JavaDiscountCourse setPrice(BigDecimal price){
        this.price = price;
        return this;
    }
    @Override
    public BigDecimal getPrice() {
        return price;
    }
}
